<?php 
function getCategory($catData, $prentsID= 0) {
           $catList = "<tr>";
           foreach($catData as $aCat) {
              if ($aCat['menu_parent'] == $prentsID) {
                 $catList .= "<td class='sub'>".$aCat['menu_title']."</td>";
                 $catList .= getCategory($catData, $aCat['menu_id']);
              }
           }
           $catList .= "</tr>";
           return $catList;
        }
        ?>